   //验证码
   //随机生成验证码
   //    function fun() {
   //        let usernumber = "0123456789abcdefghijklmnopqrstuvwxvzABCDEFGHIJKLMNOPQRSTUVWXYZ";
   //        let passnumber = "0123456789abdefABCDEF";
   //        let num = "";
   //        let pass = "#";
   //        for (let i = 0; i < 4; i++) {
   //            let n = parseInt(Math.random() * usernumber.length);
   //            num += usernumber[n];
   //        }
   //        //随机颜色
   //        for (let j = 0; j < 6; j++) {
   //            let n = Math.floor(Math.random() * passnumber.length);
   //            pass += passnumber[n];
   //        }
   //        $("#yanzhengma").val(num).css("color", pass);
   //    }
   //    fun();
   //    $("#newbtn").click(() => {
   //            fun();
   //        })
   //点击登录按钮
   $("#btn").click(function() {

       let username = $("#usname").val();
       let userpass = $("#uspass").val();
       let verification = $("#verification").val();
       let oldverification = $("#yanzhengma").val();
       //判断用户名是否填写	
       if (username === "") {
           alert("请输入用户名");
           return;
       }
       //判断密码是否填写
       if (userpass === "") {
           alert("请输入密码");
           return;
       }
       //判断验证码是否填写
       //    if (verification === " ") {
       //        alert("请输入验证码");
       //        return;
       //    }
       //判断验证码是否填写
       //    if (verification != oldverification) {
       //        alert("验证码输入错误");
       //        fun();
       //        return;
       //    }
       //发送请求
       $.ajax({
           method: "get",
           url: "http://192.168.50.142:81/selectstu",
           data: {
               name: username,
               pass: userpass
           },
           success(data) {
               if (data === "success") {
                   alert("登录成功");
                   sessionStorage.setItem("stuname", username);
                   location.href = "http://192.168.50.142/MIDO/index.html";
                   //history.back(-1);
               }
               if (data === "exist") {
                   alert("该用户不存在,请先注册");
               }
           }
       })
   })
   $(".zhuce").click(function() {
       location.href = "http://192.168.50.142/MIDO/zhuce.html";
   })